
import java.awt.Image;
import java.io.File;
import javax.swing.JFileChooser;

/**
 *
 * @author R.I.Platt
 * 
 */
public class FileHandler {

    File dir = new File("."); //get current directory
    JFileChooser fc = new JFileChooser(dir);
    File fileE2pieces;
    File savedFile;
    Image[] patternimage;

    /**
     * Open up a file browser window so you can search for the e2piece file 
     * then returns the file object  
     *
     * @return  java.io.File
     * 
     */
    public File OpenE2piecesTxtFile() {
        /* 
         * unabl to use JFilChooser from web applet ??? have to find a new
         * way of getting e2pieces file to applet if running from
         * web
        */
        int returnVal = fc.showOpenDialog(fc);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            fileE2pieces = fc.getSelectedFile();
        //System.out.println("You chose to open this file: " + fc.getSelectedFile().getName());
        }
        return fileE2pieces;
    }

    public void OpenSavedFile() {

    }

    public void SaveFile() {

    }
}
